package com.vrv.app.cyberspace.modules.sys.controller;


import com.vrv.app.cyberspace.common.utils.JSONResult;
import com.vrv.app.cyberspace.modules.sys.entity.CirculationRecordTable;
import com.vrv.app.cyberspace.modules.sys.entity.DailyReport;
import com.vrv.app.cyberspace.modules.sys.service.ICirculationRecordTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import static com.vrv.app.cyberspace.common.utils.JSONResult.renderSuccess;
import static com.vrv.app.cyberspace.common.utils.JSONResult.renderError;

/**
 * <p>
 * 流转记录表 前端控制器
 * </p>
 *
 * @author sm
 * @since 2018-01-15
 */
@RestController
@RequestMapping("/sys/circulationRecordTable")
public class CirculationRecordTableController {

    @Autowired
    private ICirculationRecordTableService circulationRecordTableService;

    /**
     * 反馈汇总中的 确定/继续跟踪/终止反馈
     */
    @RequestMapping("/add")
    public JSONResult addCirculationRecord(CirculationRecordTable circulationRecordTable) {
        return circulationRecordTableService.addCirculationRecord(circulationRecordTable) > 0 ? renderSuccess() : renderError();
    }

    /**
     * 流转记录查询
     * */
    @RequestMapping("/list")
    public JSONResult listCirculationRecord(CirculationRecordTable circulationRecordTable) {
        return renderSuccess(circulationRecordTableService.listCirculationRecord(circulationRecordTable));
    }

    /**
     * 批量 确认/继续跟踪/终止反馈
     * */
    @RequestMapping("/batch")
    public JSONResult batchCirculationRecord(CirculationRecordTable circulationRecordTable) {
        return circulationRecordTableService.batchCirculationRecord(circulationRecordTable) > 0 ? renderSuccess() : renderError("没有处理记录");
    }
}

